package produceconsumer;

import java.util.concurrent.ArrayBlockingQueue;

public class Consumer {

    private ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<>(10);
    private Object lock;
    private Integer count = 0;

    public Consumer(ArrayBlockingQueue<String> queue,Object lock) {
        this.queue = queue;
        this.lock = lock;
    }

    public void consumeProduct() throws InterruptedException {
        while(true){
            String str = queue.take();
            System.out.println(str+" is consuming");
        }
    }
}
